package cc.rengu.igas.route.common.enums;

/**
 * 审核状态枚举
 *
 * @author lizhangtao
 * @version 1.0
 * @date 20200708
 */
public enum AuditStatusEnum {

    /**
     * 新增记录时审核通过
     */
    AUDIT_ADDITION_PASS("02", "新增审核通过"),
    /**
     * 启用注销的记录审核通过
     */
    AUDIT_OPEN_PASS("32", "启用审核通过"),
    /**
     * 修改原记录后审核通过
     */
    AUDIT_MODIFY_PASS("42", "修改审核通过"),
    ;

    private String code;
    private String name;

    AuditStatusEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static AuditStatusEnum create(String code) {
        AuditStatusEnum type = null;
        if (code == null) {
            return null;
        }
        switch (code) {
            case "02":
                type = AUDIT_ADDITION_PASS;
                break;
            case "32":
                type = AUDIT_OPEN_PASS;
                break;
            case "42":
                type = AUDIT_MODIFY_PASS;
                break;
            default:
                break;
        }
        return type;
    }

    public String getCode() {
        return this.code;
    }

    public String getName() {
        return name;
    }
}
